﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication3
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                TextBox1.Text = Request.QueryString["username"];
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (TextBox2.Text == Request.QueryString["password"] && TextBox1.Text == Request.QueryString["username"])
            {
                Literal2.Text = "登录成功";
                string name = Request.QueryString["username"];
                Response.Redirect(string.Format("WebForm3.aspx?name={0}", name));
                Literal1.Text = "<a href = \" WebForm3.aspx \">转跳至登录页面</a>";
            }
            else
            {
                Literal2.Text = "账号或密码输入有误！";
            }
        }
    }
}